home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / BORUSR2.ZIP;1 / CDEFAULT.PRG < prev    next >
Encoding:
Text File  |  1992-06-24  |  2.8 KB  |  75 lines

  1. *-------------------------------------------------------------------------------
  2. *      Program: CDEFAULT.PRG
  3. *       Author: George E. McMullen
  4. *             : Borland Technical Support
  5. *         Date: 10-18-91
  6. *     Function: Utilizes COLORCTL.BIN and CLRDESC.MEM (made from SETCLR.PRG)
  7. *               to set saved color settings.
  8. * Requirements: COLORCTL.BIN
  9. *               CLRDESC.MEM (made from SETCLR.PRG)
  10. *               VGA color monitor
  11. *---
  12. *-- Ken Mayer note: I changed COLOR.MEM  to  CLRDESC.MEM, since
  13. *-- I already use COLOR.MEM for my memory variable to store the color
  14. *-- memvars. CLRDESC stands for COLOR DESCRIPTION ...
  15. *-------------------------------------------------------------------------------
  16.  
  17. *-- Setup Environment
  18. gl_escape=IIF(SET("ESCAPE")="ON","ON","OFF")
  19. SET ESCAPE OFF
  20. gl_talk=IIF(SET("TALK")="ON","ON","OFF")
  21. SET TALK OFF
  22. gl_echo=IIF(SET("ECHO")="ON","ON","OFF")
  23. SET ECHO OFF
  24. CLEAR                                  && Clear screen
  25.  
  26. *-------------------------------------------------------------------------------
  27. *--  Check for colorctl.bin and clrdesc.mem
  28. *-------------------------------------------------------------------------------
  29. IF .NOT. FILE("colorctl.bin") .OR. .NOT. FILE("clrdesc.mem")
  30.  
  31.   IF .NOT. FILE("colorctl.bin")        && Couldn't find COLORCTL.BIN
  32.     ? CHR(7)+"Error: Could not locate COLORCTL.BIN"
  33.   ENDIF
  34.  
  35.   IF .NOT. FILE("clrdesc.mem")          && Couldn't find CLRDESC.MEM
  36.     ? CHR(7)+"Error: Could not locate CLRDESC.MEM - Run SETCLR.PRG first."
  37.   ENDIF
  38.  
  39.   SET ESCAPE &gl_escape                && Reset environment
  40.   SET ECHO &gl_echo
  41.   SET TALK &gl_talk
  42.   RETURN
  43.  
  44. ENDIF
  45.  
  46. *-------------------------------------------------------------------------------
  47. *-- The files exist, load things up, and go ...
  48. *-------------------------------------------------------------------------------
  49. LOAD colorctl.bin                      && Load COLORCTL.BIN
  50. RESTORE FROM clrdesc ADDITIVE          && Get saved colors (gl_color[16,4])
  51. pv_index=1
  52. pv_new_color=""                        && Set colorctl.bin command holder
  53.  
  54. *-- load the VGA Colors ...
  55. DO WHILE pv_index<17
  56.   pv_new_color='"Index='+STR(gl_colors[pv_index,1],2)+'",'+;
  57.                '"Red='  +STR(gl_colors[pv_index,2],2)+'",'+;
  58.                '"Green='+STR(gl_colors[pv_index,3],2)+'",'+;
  59.                '"Blue=' +STR(gl_colors[pv_index,4],2)+'"'
  60.   CALL colorctl WITH '/S',&pv_new_color  && Set new index color
  61.   pv_index=pv_index+1
  62. ENDDO
  63.  
  64. *-- cleanup
  65. RELEASE module colorctl              && Release COLORCTL.BIN from memory
  66. SET ESCAPE &gl_escape                && Reset environment
  67. SET ECHO &gl_echo
  68. SET TALK &gl_talk
  69.  
  70. RETURN
  71.  
  72. *-------------------------------------------------------------------------------
  73. *-- End of Program: CDEFAULT.PRG
  74. *-------------------------------------------------------------------------------
  75.